function [ hasil ,hasil2] = y_Adams_Bashforth_Moulton2( f, x0, y0, ya, b, h )
%Y_ADAMS_BASHFORTH_MOULTON Summary of this function goes here
%   Detailed explanation goes here
    n = (b - x0) / h;
    y = y0;
    
    y1 = y_RK32(f, x0, y0, ya, x0 + h, h);
    y2 = y_RK32(f, x0, y0, ya, x0 + 2 * h, h);
    y3 = y_RK32(f, x0, y0, ya, x0 + 3 * h, h);
    x = x0 + 3 * h;
    yb = ya;
    syms a b c;
    
    for r = 4 : n
        yb = yb + h * subs(f, [a b c], [x y3 yb]);
        y = y3 + h / 24 * (-9 * ( yb + h * subs(f, [a b c], [(x-3*h) y0 yb])) + 37 *  ( yb + h * subs(f, [a b c], [(x-2*h) y1 yb ])) - 59 * ( yb + h * subs(f, [a b c], [(x-h) y2 yb])) + 55 * ( yb + h * subs(f, [a b c], [x y3 yb])));
        y = y3 + h / 24 * (( yb + h * subs(f, [a b c], [(x-2*h) y1 yb])) - 5 * ( yb + h * subs(f, [a b c], [(x-h) y2 yb])) + 19 * ( yb + h * subs(f, [a b c], [x y3 yb])) + 9 * ( yb + h * subs(f, [a b c], [(x+h) y yb])));
        
        y0 = y1;
        y1 = y2;
        y2 = y3;
        y3 = y;
        x = x + h;
    end
    
    hasil = y;
    hasil2 = yb;
end

